package com.da.springtest.spring5.factory;

import com.da.springtest.spring5.bean.Student;
import org.springframework.beans.factory.FactoryBean;

/**
 * @author JokerDa.
 * @date 2021/1/3 21:17
 * Description:
 */
public class MyBean implements FactoryBean<Student> {

    // 定义返回类型
    @Override
    public Student getObject() throws Exception {
        Student student = new Student();
        student.setName("Joker");
        student.setAge(20);
        return student;
    }

    @Override
    public Class<?> getObjectType() {
        return null;
    }

    @Override
    public boolean isSingleton() {
        return false;
    }
}
